def cache_decorator(fun):
    dic = {}

    def wrapper(*args, **kwargs):

        if args in dic.keys():
            print(f"返回结果:{dic[args]}")
            return dic[args]
        else:
            res = fun(*args, **kwargs)
            dic[args] = res
            print(f"储存结果:{res}")
            return res

    return wrapper


@cache_decorator
def func(a, b):
    return a + b


if __name__ == '__main__':
    print(func(a=1, b=2))
    print(func(a=1, b=2))
